import './index.scss';
import React, { useEffect, useState, useRef } from "react";
import { chainsall, user_wallet_list, user_wallet_info } from '@/utils/mixin.ts'
import { Button, List } from 'antd';
import { ArrowLeftOutlined, AppstoreOutlined, MessageOutlined, WalletOutlined, RightOutlined} from '@ant-design/icons';
import { useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
const Wallets = () => {
    const { t } = useTranslation();
    const navigate = useNavigate();
    const list = useState([
        {
            title: t('General'),
            key: 'General',
            icon: <AppstoreOutlined />
        },
        {
            title: t('Notification'),
            key: 'Notification',
            icon: <MessageOutlined />
        },
        {
            title: t('Wallets'),
            key: 'Wallets',
            icon: <WalletOutlined />
        },
        {
            title: 'FAQ',
            key: 'FAQ',
            icon: <AppstoreOutlined />
        },
    ]);

    // 跳转对应页面
    const goPage = (item) => {
        if (item.key === "General") {
            navigate('/dashboard/general');
        } else if (item.key === "Notification") {
            navigate('/dashboard/notification');
        } else if (item.key === "Wallets") {
            navigate('/dashboard/wallets');
        }
    }
    return (
        <div className="settings">
            <div className="header_settings">
                <Button type="text" className="goBackBtn" onClick={() => navigate('/dashboard/ethbot')} icon={<ArrowLeftOutlined />}></Button>
                <p className="title">{t('set up')}</p>
            </div>
            <div className="content_settings">
                <List
                    className="demo-loadmore-list"
                    itemLayout="horizontal"
                    dataSource={list[0]}
                    renderItem={(item) => (
                        <List.Item
                            actions={[<RightOutlined />]}
                            onClick={() => goPage(item)}
                        >
                            <List.Item.Meta
                                avatar={item.icon}
                                title={item.title}
                            />
                        </List.Item>
                    )}
                />
            </div>
        </div>
    )

}

export default Wallets;